# Maintainer: ungleich <alpinelinux@ungleich.ch>
pkgname=blackbox_exporter
pkgver=0.17.0
pkgrel=0
pkgdesc="Prometheus Blackbox Exporter"
url="https://github.com/prometheus/blackbox_exporter"
arch="all !mips !mips64"
license="Apache-2.0"
install="$pkgname.pre-install"
makedepends="go"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/prometheus/blackbox_exporter/archive/v$pkgver.tar.gz
	blackbox_exporter.confd
	blackbox_exporter.initd
"
subpackages="$pkgname-openrc"

build() {
	go build
}

check() {
	go test
}

package() {
	install -Dm755 blackbox_exporter "$pkgdir"/usr/bin/blackbox_exporter

	install -Dm755 "$srcdir"/blackbox_exporter.initd \
		"$pkgdir"/etc/init.d/blackbox_exporter
	install -Dm644 "$srcdir"/blackbox_exporter.confd \
		"$pkgdir"/etc/conf.d/blackbox_exporter
	install -dm644 "$pkgdir"/etc/blackbox_exporter
	install -Dm644 blackbox.yml \
		"$pkgdir"/etc/blackbox_exporter/blackbox.yml
}
sha512sums="9e79d083c5c8caebbc19b6feef04dd189bc91a72dcb3aa946a96543fbe28ae2c49cafeed3f42618747661421897adc17988ffc6cf0d7054cf0a385b85eeafc61  blackbox_exporter-0.17.0.tar.gz
e850f8414af33333619946d9163169411a8b5c27dc3611cc27a0c3185748feab3fa31a02ba00d421be9ea16fd2eb2d6395b1438b6d0b0f088eecf93010866d9b  blackbox_exporter.confd
668b3b027a56959cdf81f6a97a79c0e8c5b043a110591f706f52698a4e705d96833671caf8348dd64f25c69809448925d4522a569066359e89212c7c61eae0ab  blackbox_exporter.initd"
